package command;

import interfata.DesenArbore;

import javax.swing.JButton;
import javax.swing.JFrame;

import arbori.ArboreFunctional;
import arbori.Nod;

//@SuppressWarnings("serial")

public class DesenareArboreCommand extends JButton implements Command {
	protected ArboreFunctional a;
	public DesenareArboreCommand(String nume)
	{
		super(nume);
	}
	public void setArbore(Nod n)
	{
		this.a=new ArboreFunctional(n);
	}
	/**
	 * deschide un frame nou in care se va apela functia de desenare a arborelui
	 */
	public void execute()
	{
		JFrame f = new JFrame();
        f.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        DesenArbore desen=new DesenArbore();
        desen.setArbore(a.getRadacina());
        f.add(desen);
        f.setSize(1000,600); 
        f.setLocation(50,50);
        f.setVisible(true);

	}

}
